﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using KraveDAL;

public partial class changepassword : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        LoginDAL ld = new LoginDAL();
        int id = 0;
        string oldP;
        string newP;
       

        id = Convert.ToInt32(TextBox1.Text);
        oldP = TextBox2.Text;
        newP = TextBox3.Text;

        bool rValue = ld.ChangePassword(id , oldP , newP);
        if (rValue == true)
        {
            Response.Redirect("updatesuccessful.aspx");
        }
        else
        {
            Response.Redirect("errorpage.aspx");
        }
    }
}